<script setup>
import '@/assets/font/iconfont.js'

const props = defineProps({
  color: {
    type: String,
    default: '',
  },
  size: {
    type: String,
    default: '14px',
  },
  name: {
    type: String,
    default: '',
  },
})
const iconName = computed(() => {
  return '#' + props.name
})
</script>
<script>
export default {
  name: 'DuIcon',
}
</script>

<template>
  <svg class="icon" aria-hidden="true" :style="{ fontSize: props.size, color: props.color }">
    <use :xlink:href="iconName"></use>
  </svg>
</template>

<style scoped lang="scss">
.icon {
  width: 1em;
  height: 1em;
  //vertical-align: -0.15em;
  vertical-align: middle;
  fill: currentColor;
  overflow: hidden;
}
</style>
